package com.probox.common.entity.vo.store;

import cn.hutool.core.util.NumberUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.probox.common.core.annotation.Excel;
import com.probox.common.core.enums.StoreServiceTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class StoreInfoVo implements java.io.Serializable{
    /**
     * $column.columnComment
     */
    //默认主键自增
    @TableId(value = "STORE_UID", type = IdType.AUTO)
    private Long storeUid;


    /**
     * 门店名称
     */
    @Excel(name = "门店名称")
    @ApiModelProperty(value = "门店名称")
    private String storeName;

    /**
     * 联系人
     */
    @Excel(name = "联系人")
    @ApiModelProperty(value = "联系人")
    private String storeContacts;

    /**
     * 联系电话
     */
    @Excel(name = "联系电话")
    @ApiModelProperty(value = "联系电话")
    private String storePhone;

    /**
     * 门店省份
     */
    @Excel(name = "门店省份")
    @ApiModelProperty(value = "门店省份")
    private String storeProvince;

    /**
     * 门店城市
     */
    @Excel(name = "门店城市")
    @ApiModelProperty(value = "门店城市")
    private String storeCity;

    /**
     * 门店区域
     */
    @Excel(name = "门店区域")
    @ApiModelProperty(value = "门店区域")
    private String storeArea;

    /**
     * 门店详细地址
     */
    @Excel(name = "门店详细地址")
    @ApiModelProperty(value = "门店详细地址")
    private String storeAddress;

    /**
     * 门店banner
     */
    @Excel(name = "门店banner")
    @ApiModelProperty(value = "门店banner")
    private String storeBanner;

    /**
     * 经度
     */
    @Excel(name = "经度")
    @ApiModelProperty(value = "经度")
    private String storeLongitude;

    /**
     * 纬度
     */
    @Excel(name = "纬度")
    @ApiModelProperty(value = "纬度")
    private String storeLatitude;

    //服务类别(Life-生美/Medical-医美/probxplus-菠萝+)
    private String serviceType;

    public String getServiceTypeFmt(){
        return StoreServiceTypeEnum.getNameByKey(serviceType);
    }

    //距离
    private Double distance;

    //营业开始时间
    private String startTime;
    //营业结束时间
    private String endTime;


    //预约提示
    private String subscribeTip;

    public String getDistanceFmt(){
        if (distance == null){
            return "";
        }
        if (distance > 1000) {
            return NumberUtil.decimalFormat("#.#", distance / 1000.0) + "公里";
        } else {
            return NumberUtil.decimalFormat("#.#", distance) + "米";
        }
    }
}
